package ru.sgu.acm;

/**
 * TODO: class documentation
 *
 * @author Vitaly Goldshteyn (VitalyGoldstein@gmail.com)
 */
public class SourceGenerator {
    public static String getPascalCESource() {
        return "var\nbegin\nread(a, b);\nwrite(a*b);\nend.\n";
    }

    public static String getPascalWASource() {
        return "var\na, b : longint;\nbegin\nread(a, b);\nwrite(a*b+b*a+136);\nend.\n";
    }

    public static String getPascalRESource() {
        return "var\na, b, c : longint;\n" +
                "x : array[1..100] of longint;\n" +
                "begin\nread(a, b);\n" +
                "for a:= 1 to 10000000 do x[a] := 13;" +
                "\nend.\n";
    }

    public static String getPascalTLSource() {
        return "var\na, b : longint;\nbegin\nread(a, b);" +
                "\nwhile (true) do;\nend.\n"; 
    }

    public static String getPascalMLSource() {
        return "type ar = array[1..1000000] of longint;\n" +
                "var\n" +
                "a : ^ar;" +
                "\n" +
                "b : array [1..50] of ar;\n" +
                "begin\n" +
                "    while (true) do b[random(50) + 1][random(1000000) + 1] := 1;    \n" +
                "end.";
    }

    public static String getPascalACSourceOfAPlusB() {
        return "var\na, b : longint;\nbegin\nread(a, b);\nwrite(a+b);\nend.\n";
    }

    public static String getPascalACSourceOfAPlusBMultiple() {
        return "var\na, b : longint;\nbegin\nwhile not seekeof() do\n" +
                "begin\nread(a, b);\nwriteln(a+b);\nend;\nend.\n";
    }

    public static String getPascalPESource() {
        return "var\na, b : longint;\nbegin\nread(a, b);\nwrite('hello');\nend.\n";
    }

    public static String getPascalUva11547Solution() {
        return "var\n" +
                "    ii, t, x : longint;\n" +
                "begin\n" +
                "    read (t);\n" +
                "    for ii:= 1 to t do begin\n" +
                "        read(x);\n" +
                "        x := (x * 63 + 7492) * 5 - 498;\n" +
                "        x := abs(x mod 100) div 10;\n" +
                "        writeln(x);\n" +
                "    end;\n" +
                "end.";
    }
}
